#include "../lib_include/Poller.h"
#include "../lib_include/Channel.h"

using namespace netlib;
using namespace netlib::net;

Poller::Poller(EventLoop* loop)
  : ownerLoop_(loop)
{ }

Poller::~Poller() = default;

bool Poller::hasChannel(Channel* channel) const // 判断该通道是否在poll参数列表中
{
    assertInLoopThread();
    ChannelMap::const_iterator it = channels_.find(channel->fd());
    return it != channels_.end() && it->second == channel;
}

